<?php
//test
$messages = array();
$path = __DIR__.DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR;
@mkdir($path);
if(isset($_FILES['files']['tmp_name'])) {
	if (is_array($_FILES['files']['name'])) {
		foreach($_FILES['files']['name'] as $id => $name) {
			$uploadfile = $path.basename($_FILES['files']['name'][$id]);
			@move_uploaded_file($_FILES['uploads']['tmp_name'][$id], $uploadfile);
		}
	} else {
		$uploadfile = $path.basename($_FILES['files']['name']);
		@move_uploaded_file($_FILES['files']['tmp_name'], $uploadfile);
	}
}
echo json_encode(array('status' => 'OK'));
?>	
